<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style>
</style>
</head>
<body>
	<div class="panel panel-info panel-content">
		<form id="seoform">
			<div style="margin:15px">
				<input type="hidden" name="proCategoryId" value="${category.id!}" />
				<input type="hidden" name="id" value="[#if proCategorySeo??]${proCategorySeo.id!}[/#if]" />
				<div class="form-group">
					<label for="name">META Title（类目标题）：</label>
					<div>
						<input class="form-control" style="width: 200px" placeholder="针对搜索引擎设置的标题"
							required="required" maxlength="100" name="title"
							value="[#if proCategorySeo??]${proCategorySeo.title!}[/#if]" />
					</div>
				</div>
				<div class="form-group">
					<label for="name">META Keywords（类目关键词）：</label>
					<div>
						<textarea style="resize: none; width: 500px; height: 50px" placeholder="关键字中间用半角逗号隔开"
							name="keywords" required="required" maxlength="500">[#if proCategorySeo??]${proCategorySeo.keywords!}[/#if]</textarea>
					</div>
				</div>
				<div class="form-group">
					<label for="name">META Description（栏目描述）：</label>
					<div>
						<textarea style="resize: none; width: 500px; height: 200px" placeholder="针对搜索引擎设置的网页描述"
							name="descr" required="required" maxlength="1024">[#if proCategorySeo??]${proCategorySeo.descr!}[/#if]</textarea>
					</div>
				</div>
				<div class="form-group">
					<button onclick="subseo();" type="button" class="btn btn-success">提交</button>
				</div>
			</div>
		</form>
	</div>
</body>
<script>
	function subseo() {
		//Seo提交
		$.ajax({
			type : "POST",
			dataType : "json",
			url : "/category/o_productseo.do",
			data : $("#seoform").serialize(),
			beforeSend : function() {
				art.dialog.tips("提交中....", 2);
			},
			success : function(data) {
				if (data.success) {
					refeshseo();
				} else {
					art.dialog.tips(data.msg);
				}
			}
		});
	}

	//刷新SEO页面
	function refeshseo() {
		$.messager.progress({
			text : "loadding",
			interval : 100
		});
		$("#productseo").load(
				'/category/v_productseo_list.do?so_id=${category.id!}',
				function() {
					$.messager.progress('close');
				});
	}
</script>
</html>